www.gusucode.com > PHP展示型企业网站模板米拓整站源码 1.0PHP源码程序 > PHP展示型企业网站模板米拓整站源码 1.0/MetInfozs_v1.0/MetInfozs_v1.0/app/system/include/static/js/plugins/action-btn.min.js

    /*!
 * remark (http://getbootstrapadmin.com/remark)
 * Copyright 2015 amazingsurge
 * Licensed under the Themeforest Standard Licenses
 */
!function(window,document,$){"use strict";var pluginName="actionBtn",Plugin=$[pluginName]=function(element,options){this.element=element,this.$element=$(element),this.options=$.extend({},Plugin.defaults,options,this.$element.data()),this.init()};Plugin.defaults={trigger:"click",toggleSelector:".site-action-toggle",listSelector:".site-action-buttons",activeClass:"active",onShow:function(){},onHide:function(){}},Plugin.prototype={constructor:Plugin,init:function(){this.showed=!1,this.$toggle=this.$element.find(this.options.toggleSelector),this.$list=this.$element.find(this.options.listSelector);var self=this;"hover"===this.options.trigger?(this.$element.on("mouseenter",this.options.toggleSelector,function(){self.showed||self.show()}),this.$element.on("mouseleave",this.options.toggleSelector,function(){self.showed&&self.hide()})):this.$element.on("click",this.options.toggleSelector,function(){self.showed?self.hide():self.show()})},show:function(){this.showed||(this.$element.addClass(this.options.activeClass),this.showed=!0,this.options.onShow.call(this))},hide:function(){this.showed&&(this.$element.removeClass(this.options.activeClass),this.showed=!1,this.options.onHide.call(this))}},$.fn[pluginName]=function(options){if("string"!=typeof options)return this.each(function(){$.data(this,pluginName)||$.data(this,pluginName,new Plugin(this,options))});var method=options,method_arguments=Array.prototype.slice.call(arguments,1);if(/^\_/.test(method))return!1;if(!/^(get)$/.test(method))return this.each(function(){var api=$.data(this,pluginName);api&&"function"==typeof api[method]&&api[method].apply(api,method_arguments)});var api=this.first().data(pluginName);return api&&"function"==typeof api[method]?api[method].apply(api,method_arguments):void 0}}(window,document,jQuery);